package org.crackjack.android.activity;

import java.util.ArrayList;

import android.app.Activity;
import android.content.Intent;
import android.os.Parcelable;
import android.widget.Toast;

public class GenericActivity extends Activity {

    public void startActivity(Class<?> activityClass) {
        Intent intent = new Intent();
        intent.setClass(this, activityClass);
        startActivity(intent);
    }

    public void startActivity(Class<?> activityClass, String listName, ArrayList<? extends Parcelable> parcelableObjects) {
        Intent intent = new Intent();
        intent.setClass(this, activityClass);
        intent.putParcelableArrayListExtra(listName, parcelableObjects);
        startActivity(intent);
    }

    public void showToast(String text) {
        showToast(text, 2000);
    }

    public void showToast(String text, int duration) {
        Toast.makeText(this, text, duration).show();
    }
}
